home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / TC Prog Guide.cpt / picture ƒ / trans.h < prev   
Text File  |  1990-11-08  |  2KB  |  76 lines

  1. /*
  2. *    FILE:        trans.h
  3. *    AUTHOR:        R. Gonzalez
  4. *    CREATED:    October 3, 1990
  5. *
  6. *    Defines 3D transformation (using trans. matrix) for picture
  7. *    application.
  8. */
  9.  
  10. # ifndef    trans_h
  11. # define    trans_h
  12.  
  13. # include    "class.h"
  14. # define    PI        3.1415926
  15.  
  16. /******************************************************************
  17. *   abstract transformation
  18. ******************************************************************/
  19. struct    Transformation:Generic_Class
  20. {
  21.     double            m[4][4];    /* public */
  22.     
  23.     boolean            init(void);
  24.     virtual void    combine(Transformation*,Transformation*);
  25.     virtual void    equate(Transformation*);
  26. };
  27.  
  28. /******************************************************************
  29. *   translation
  30. ******************************************************************/
  31. struct    Translation:Transformation
  32. {
  33.     virtual void    set(double,double,double);
  34. };
  35.  
  36. /******************************************************************
  37. *   scaling
  38. ******************************************************************/
  39. struct    Scaling:Transformation
  40. {
  41.     virtual void    set(double,double,double);
  42. };
  43.  
  44. /******************************************************************
  45. *   rotation about x
  46. ******************************************************************/
  47. struct    Rotation_X:Transformation
  48. {
  49.     virtual void    set(double);
  50. };
  51.  
  52. /******************************************************************
  53. *   rotation about y
  54. ******************************************************************/
  55. struct    Rotation_Y:Transformation
  56. {
  57.     virtual void    set(double);
  58. };
  59.  
  60. /******************************************************************
  61. *   rotation about z
  62. ******************************************************************/
  63. struct    Rotation_Z:Transformation
  64. {
  65.     virtual void    set(double);
  66. };
  67.  
  68. /******************************************************************
  69. *   convert from world to camera coordinates
  70. ******************************************************************/
  71. struct    World_To_Camera:Transformation
  72. {
  73.     virtual void    set(double,double,double,double,double,double);
  74. };
  75.  
  76. # endif